import pytest


def test_get_event():
    print("查询发布会")
    actual_name = '小米16发布会'
    expected_name = '小米16发布会'
    assert actual_name == expected_name

def test_get_event2():
    print("查询发布会2")
    actual_name = '小米22'
    expected_name = "小米16发布会"
    assert actual_name == expected_name # 报错，断言失败

def test_bool():
    print("断言布尔值")
    assert False == True
    assert False is True
# pytest 02-pytest断言方式.py::test_bool

def test_order():
    print("测试订单")
    # 断言的订单编号
    assert 20220530110 == 20220530110
    # 断言订单状态
    assert  "已付款" == "未付款"
    """
    用assert断言的方式，只要出现了错误就停止掉，报错
    后续的代码块不会再执行了
    """
    print("开始断言订单金额")
    # 断言订单金额
    assert 100 == 100
# pytest D:\Users\Administrator\PycharmProjects\qc1-python-fundamentals\pytest测试框架\02-pytest断言方式.py::test_order


# ===================================使用pytest.assume方式进行断言=======================

def test_get_event1():
    print("查询发布会1号")
    expected_name = "小米"
    actual_name = "小米发布会"
    assert expected_name in actual_name

# pytest 02-pytest断言方式.py::test_get_event1

def test_bool1():
    print("断言布尔值")
    assert False == True # 用assert方法，判断在这里已经出错了，后面的False is True就不会再执行了
    assert False is True
"""
assume方法进行断言，即使前面出现了报错，后面的代码也会执行
"""
def test_order1():
    print("测试订单")
    pytest.assume(20220530110==20220530110)
    # 断言订单状态
    pytest.assume("已付款" == "未付款") # x
    print("开始断言订单金额")
    # 断言订单金额
    pytest.assume(100==10) # x














